<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Register</title>
<script type="text/javascript">
function register(){
	var th = document.form1;
	if(th.userName.value==""){
		alert("UserName Can't Be Null");
		th.userName.focus();
		return;
	}
	if(th.email.value==""){
		alert("Email Can't Be Null");
		th.email.focus();
		return;
	}
	if(th.password.value==""){
		alert("Password Can't Be Null");
		th.password.focus();
		return;
	}
	if(th.password.value != th.psw.value){
		alert("The Two Passwords Don't Match!");
		th.psw.focus();
		return;
	}
	th.action="<%=path%>/RegisterServlet";
	th.submit();
}
</script>
</head>
<body>
	<div align="center">
		<form name="form1" action="" method="post">
			<table>
				<tr>
					<td>UserName:</td>
					<td><input name="userName"></td>
				</tr>
				<tr>
					<td>Email:</td>
					<td><input name="email"></td>
				</tr>
				<tr>
					<td>Password:</td>
					<td><input type="password" name="password"></td>
				</tr>
				<tr>
					<td>ConfirmPassword:</td>
					<td><input type="password" name="psw"></td>
				</tr>
				<tr>
					<td><input type="button" value="注册" onclick="register()"></td>
					<td><input type="button" value="返回"
						onclick="javascript:location.href='login.jsp'">
				</tr>
				<tr>${msg}</tr>
			</table>
		</form>
	</div>
</body>
</html>